package filters;

import draw.ExploringMedics;

public class LogColorFilter extends AbstractColorFilter{

    public LogColorFilter(int[][] imageDescription) {
        super(imageDescription);
    }

    @Override
    public void doFilted() {
        int c = 32;
        double log2 = Math.log(2);
        for (int i = 0; i < width; i++) {
            for (int j = 0; j < height; j++) {
                
                imageDescription[i][j] = (int) (c * Math.log(1 + imageDescription[i][j])/log2);
                if (imageDescription[i][j]>ExploringMedics.WHITE){
                    imageDescription[i][j] = ExploringMedics.WHITE;
                }
            }
        }
    }
    
}
